import React, { memo } from "react";
import { useNavigate } from "react-router-dom";
import { Form, Button, Input, TimePicker, Table } from "antd";

export default function ErrorLog() {
  type FieldType = {
    type?: string;
    time?: string;
    reason?: string;
  };

  const [form] = Form.useForm();

  const onFinish = (values: any) => {
    console.log(values);
  };

  interface DataType {
    key: string;
    name: string;
    age: number;
    address: string;
    tags: string[];
  }

  return (
    <>
      <Form
        name="basic"
        style={{ maxWidth: "none" }}
        layout="inline"
        autoComplete="off"
        form={form}
        onFinish={onFinish}
        className="grid grid-cols-6 gap-4 my-8"
      >
        <Form.Item<FieldType> name="type">
          <Input placeholder="故障类型" />
        </Form.Item>

        <Form.Item<FieldType> name="time">
          <TimePicker.RangePicker />
        </Form.Item>

        <Form.Item<FieldType> name="reason" className="col-span-3">
          <Input placeholder="故障原因" />
        </Form.Item>

        <Form.Item>
          <Button type="primary" htmlType="submit">
            查询
          </Button>
        </Form.Item>
      </Form>

      {/* <Table columns={columns} dataSource={data} /> */}
    </>
  );
}
